package org.idea.qiyu.framework.canal.split.table.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @Author linhao
 * @Date created in 8:17 下午 2021/6/21
 */
@Mapper
public interface UserMapper {

    /**
     * $符号不会携带引号，#符号会携带引号
     *
     * @param index
     * @param userId
     * @param username
     */
    @Insert("insert into t_user_${index} (user_id,username) values (#{userId},#{username})")
    void insertOne(@Param("index") String index,@Param("userId")Long userId,@Param("username") String username);

    /**
     * 往用户表中写入数据
     * '
     * @param userId
     * @param username
     */
    @Insert("insert into t_user (user_id,username) values (#{userId},#{username})")
    void insert(@Param("userId")Long userId,@Param("username") String username);
}
